package lab02.test05;

/**
 * Created by Lenovo on 2017/10/15.
 */
public class Cube {
    //属性:长、宽、高
    float length;
    float width;
    float height;
    //行为:体积
    public Cube(float l,float w,float h ){
        this.setHeight(l);
        this.setWidth(w);
        this.setLength(h);
    }
    public float V(){
        float vl=length*width*height;
        return vl;
    }
    public String toString(){
        return "长"+getLength()+"\n"+
                "宽"+getWidth()+"\n"+
                "高"+getHeight()+"\n";
    }
    //构造函数

    public float getLength() {
        return length;
    }

    public void setLength(float length) {
        this.length = length;
    }

    public float getWidth() {
        return width;
    }

    public void setWidth(float width) {
        this.width = width;
    }

    public float getHeight() {
        return height;
    }

    public void setHeight(float height) {
        this.height = height;
    }

    //main函数
}
